<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class drCoreAutoloader{
    
    protected function __construct() {}
    
    public function getInstance(){
      static $instance;
      if(!isset($instance)) {
         $instance = new drCoreAutoloader();
      }
      return $instance;
    }
    
    public function start(){
        $path = array_reverse(explode('/', __DIR__));
        array_shift($path);
        $path = implode('/', array_reverse($path));
        /**
         * @todo replace with $_SERVER['DOCUMENT_ROOT'];
         */
        foreach (glob($path."/*/*.php") as $filename) {
            if(basename($filename)!="drCoreAutoloader.class.php"){
                include_once $filename;
            }
        }
    }
}
